@ECHO OFF

cd ..\wsp

SET SITE_URL="http://localhost:11139"
SET SOLUTION_NAME=$safeprojectname$.wsp

REM ----- Deactivate the feature(s) -----
REM stsadm -o deactivatefeature -name featurename -url %SITE_URL% -force

REM ----- Remove the features and solution -----
stsadm -o retractsolution -name %SOLUTION_NAME% -immediate -url %SITE_URL%


ECHO .
ECHO .
ECHO -------------------------------------------------------------------------------------------
ECHO Verify that the correct solutions have been completly retracted and then press ENTER
ECHO -------------------------------------------------------------------------------------------
ECHO .

stsadm -o execadmsvcjobs

ECHO ON

REM ----- Delete the solution -----
stsadm -o deletesolution -name %SOLUTION_NAME%

REM ----- Add and depoly the solution -----
stsadm -o addsolution -filename %SOLUTION_NAME%
stsadm -o deploysolution -n %SOLUTION_NAME% -immediate -allowgacdeployment -allowCasPolicies -url %SITE_URL%


ECHO OFF
ECHO .
ECHO .
ECHO -------------------------------------------------------------------------------------------
ECHO Solution deployment complete, press ENTER to activate features, if any
ECHO -------------------------------------------------------------------------------------------

stsadm -o execadmsvcjobs

ECHO ON
REM ----- Active features -----
REM stsadm -o activatefeature -name featurename -url %SITE_URL% -force

REM ----- Remove the following comment if features are present
REM pause